=========================================================================== BBS: The Abacus * HST/DS * Potterville MI Date: 02-28-93 (21:27) Number: 13 From: VICTOR YIU Refer#: NONE To: ALL Recvd: NO Subj: SpaceOut 1.0 ---> 1/3 Conf: (35) Quick Basi --------------------------------------------------------------------------- 'Hello, All! ' ' After looking at Quinn Tyler Jackson's QOMPRESS, I felt that a faster, 'and tighter compressor for text could be written... and guess what... 'here comes this program! ' ' Part one of SPACEOUT.BAS... '________O_/________________________| SNIP |______________________\_O_______ ' O \ | HERE | / O ' ============================================= ' SpaceOut v1.0 þ by Victor Yiu þ Feb. 26, 1993 ' ============================================= ' þ QBS = YES! ' ' This is a much better compressor of plain text than ' Quinn Tyler Jackson's QOMPRESS, although it does strip ' up characters ASCII >128. Characters like that are ' almost illegal to post in echos anyway, so it really ' doesn't matter. ' ' What is different is that this compressor is FAST ' in just QB only code. It is optimized TO THE MAX! ' With direct string manipulation (no more MID$) and ' block transfers, it is the fastest text compression ' code I have seen. Even faster compiled! ' ' I have done some benchmarking... and here are the ' results: ' ' All tests run compiled on a 486/34. Input file: ' TELIX.DOC (documentation file for Telix 3.21) (215K) ' +--------------------------+--------------------------+ ' | QOMPRESS | SPACEOUT | ' +--------------------------+--------------------------+ ' | Saved 28956 bytes | Saved 42389 bytes | ' | Time required: 27.6 secs.| Time required: .38 secs. | ' +--------------------------+--------------------------+ ' ' That's right, folks -- SPACEOUT is 75 times faster -- ' and it compresses text 46% better. ;-) Sorry, Quinn... ' no bashing intended... would this be helpful to ' QBCIMR? It is a small, yet powerful and fast routine ' that can be applied easily... You can run vy.Encode ' for every message (I'm glad they are <16K). Average ' compression savings are around 20%. ' ' Well, granted, it isn't going to compress it as well ' as PKZIP or ARJ, but it's just a beginning. It's in ' 100% QB and it's fast. ' ' Warning: DO NOT BREAK OUT WHEN IT IS COMPRESSING. The ' data you are compressing will be corrupted. DECLARE FUNCTION vy.Decode% (Text$) DECLARE FUNCTION vy.Encode% (Text$) DEFINT A-Z CONST True = -1, False = 0 PRINT PRINT "SpaceOut v1.0 þ by Victor Yiu þ Public Domain" PRINT STRING$(45, "~") PRINT F$ = COMMAND$ IF LEN(F$) = 0 THEN INPUT "Filename"; F$ OPEN F$ FOR BINARY AS #1 InL& = LOF(1) OutL& = 0 PRINT PRINT "Sawing ..."; T! = TIMER DO SELECT CASE InL& - SEEK(1) + 1 CASE IS > 8192 Block$ = SPACE$(8192) CASE IS <= 0 EXIT DO CASE ELSE Block$ = SPACE$(InL& - SEEK(1) + 1) END SELECT GET #1, , Block$ Ok = vy.Encode(Block$) IF NOT Ok THEN EXIT DO OutL& = OutL& + LEN(Block$) LOOP CLOSE 'Continued on next message... --- Blue Wave/RA v2.10 [NR] * Origin: Hard Disc Cafe / Houston Texas / (713) 589-2690 / Node -*N (1:106/30. 0) SEEN-BY: 1/211 11/2 4 13/13 101/1 108/89 109/25 110/69 114/5 123/19 124/1 SEEN-BY: 153/752 154/40 77 157/2 159/100 125 430 950 203/23 209/209 280/1 SEEN-BY: 390/1 396/1 15 397/2 2230/100 3603/20